package com.sbxApp.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.common.validations.RequiredField;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotEmpty;
import java.util.Date;
import java.util.List;

@Data
@TableName("cloud_disk")
@Accessors(chain = true)
public class CloudDisk {
    @TableId(type = IdType.ASSIGN_UUID)
    private String id;

    @ApiModelProperty("源文件/文件夹名称")
    @NotEmpty(message = "源文件/文件夹名称不能为空",groups = RequiredField.class)
    private String originName;

    @ApiModelProperty("file-文件,,dir-文件夹")
    @NotEmpty(message = "类型不能为空",groups = RequiredField.class)
    private String type;

    @ApiModelProperty(value ="文件夹id" )
    private String parentId;

    @ApiModelProperty(value = "创建人")
//    @NotEmpty(message = "创建人不能为空",groups = RequiredField.class)
    private String creator;

    @ApiModelProperty(value = "创建时间")
//    @NotEmpty(message = "创建时间不能为空",groups = RequiredField.class)
    private Date created;

    @ApiModelProperty(value = "修改时间")
    private Date updated;

    @ApiModelProperty(value = "文件大小")
    private long size;

    @ApiModelProperty(value = "public-公开,private-私有")
    private String visit;

    @ApiModelProperty(value = "改后的文件名称")
    private String minioFileId;

    @ApiModelProperty(value = "全路径")
    private String fullPath;

    @ApiModelProperty(value = "桶名称")
    private String bucket;

    @ApiModelProperty(value = "子文件")
    @TableField(exist = false)
    private List<CloudDisk> children;

}
